package controllers;

import connectivity.Dbmanager;
import connectivity.QueryManager;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ViewEditableCoursesController extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        Dbmanager dbManager = new Dbmanager();
        dbManager.openConnection();
        QueryManager queryManager = new QueryManager(dbManager);

        request.setAttribute("coursesUitSessie", queryManager.getAllCourses());

        dbManager.closeConnection();

        RequestDispatcher dispatcher = request.getRequestDispatcher("/view_editable_courses.jsp");
        dispatcher.forward(request, response);

    }
}
